<div  class=" admin-content">
    <div class="admin-biaogelist">

        <div class="listbiaoti am-cf">
            <ul class="am-icon-users"> 部门管理</ul>

            <dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="#">部门管理</a></dl>

            <dl>
                <button ng-click="openAddDepartModal()" type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus" > 新增</button>
            </dl>
            <!--这里打开的是新页面-->
        </div>
        <form class="am-form am-g">
            <table width="100%" class="am-table am-table-bordered am-table-radius am-table-striped">
                <thead>
                <tr class="am-success">
                    <th class="table-check"><input type="checkbox" /></th>
                    <th class="table-title">部门名</th>
                    <th class="table-author ">部门负责人</th>
                    <th class="table-author ">电话</th>
                    <th class="table-author ">邮箱</th>
                    <th class="table-author am-hide-sm-only">操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="item in list">
                    <td><input type="checkbox" /></td>
                    <td>{{item.name}}</td>
                    <td>{{item.manager_name}}</td>
                    <td>{{item.phone}}</td>
                    <td>{{item.email}}</td>
                    <td>
                        <div class="am-btn-toolbar">
                            <div class="am-btn-group am-btn-group-xs">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button ng-click="openUpdateDepartModal(item.id)"  class="am-btn am-btn-default am-btn-xs am-text-secondary am-round" data-am-modal="{target: '#my-popups'}" title="修改"><span class="am-icon-pencil-square-o" ></span></button>
                                    <button ng-click="delete(item.id)" class="am-btn am-btn-default am-btn-xs am-text-danger am-round"  title="删除"><span class="am-icon-trash-o"></span></button>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>
            <ul class="am-pagination am-fr">
                <div class="box-footer no-border">
                    <pagination-component total-items="listData.totalCounts"
                                          current-page="listData.pageIndex"
                                          page-size="listData.pageSize"
                                          select-page="NextListData(pageIndex)">
                    </pagination-component>
                </div>
            </ul>
            <hr />
            <!--<p>注：.....</p>-->
        </form>
    </div>

</div>
</div>

<div class="modal fade" id="addDepartModal"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="z-index:9999;">
        <div class="modal-content">
            <div class="modal-header">

                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>

                <h4 class="modal-title" id="dayclearModalLabel">
                    部门信息填写
                </h4>
            </div>
            <div class="modal-body">
                <form role="form">
                    <div class="form-group">
                        <label >部门名</label>
                        <input type="text" ng-model="addDepartDataName" class="form-control"
                               placeholder="部门名">
                        <input type="hidden" class="form-control" >
                    </div>

                    <div class="form-group">
                        <label >负责人</label>
                        <!--<input type="text" ng-model="manager.name" class="form-control"
                               placeholder="请输入提示信息">-->
                        <select ng-model="manager" class="form-control"
                                ng-options="am.name for am in departManager">
                        </select>
                        <!--<input type="text" ng-model="manager" class="form-control"
                               placeholder="请输入提示信息">
                        <ul>
                            <li ng-repeat="dm in departManager | filter : manager" ng-hide="true">{{ dm.name }}</li>
                        </ul>-->
                    </div>
                    <div class="form-group">
                        <label>电话</label>
                        <input  class="form-control" type="text" ng-model="manager.phone"
                                placeholder="电话">
                        <input type="hidden" class="form-control" >
                    </div>
                    <div class="form-group">
                        <label>邮箱</label>
                        <input  class="form-control" type="text" ng-model="manager.email"
                                placeholder="邮箱">
                        <input type="hidden" class="form-control" >
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                <button type="button" id="addDaycl" ng-click="addDepart(addDepartDataName,manager)" class="btn btn-primary">
                    提交
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<div class="modal fade" id="UpdateDepartModal"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="z-index:9999;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                    &times;
                </button>
                <h4 class="modal-title" id="nodeModalLabel">

                    部门信息修改

                </h4>
            </div>
            <div class="modal-body">
                <form role="form">
                    <div class="form-group">
                        <label>部门名</label>
                        <input type="text" class="form-control" id="number"
                               placeholder="部门名" ng-model="updateDepart.name">
                        <input type="hidden" class="form-control" >
                    </div>
                    <div class="form-group">
                        <div class="form-group">
                            <label >负责人</label>
                            <select ng-model="updateManager" class="form-control"
                                    ng-options="um.name for um in departManager ">
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label>电话</label>
                        <input type="text" class="form-control"
                               placeholder="电话"  ng-model="updateManager.phone" id="name">
                        <input type="hidden" class="form-control" >
                    </div>
                    <div class="form-group">
                        <label>邮箱</label>
                        <input type="text" class="form-control"
                               placeholder="邮箱"  ng-model="updateManager.email">
                        <input type="hidden" class="form-control" >
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                <button type="button" id="SelectDepartDataSubmit"  ng-click="Update(updateManager,updateDepart)" class="btn btn-primary">

                    更新
                </button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
